<@override name="head">
<title>总体报表</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="${ctx}/assets/css/daterangepicker.css"/>
<script type="text/javascript" src="${ctx}/assets/js/lib/moment.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/lib/jquery.daterangepicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/lib/date.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/commoncombobox.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/shortcutkey_datePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/report_advertiser.js"></script>
</@override>
<@override name="body">
<div id=content_bg>
   	<#include "/main/home/common.ftl"/>
    <div id="pagecontent">
    	<div id="content">
	   		<div id="navDiv">
				<ul id="navDiv_ul">
					<li><i class="icon-home"></i></li>
					<li><a href="${ctx}/advertiser/main/dashboard">首页</a></li>
					<li><i class="icon-angle-right"></i></li>
				    <li class="navDiv_currentLi">数据报表</li>
				</ul>  
 			</div>
	 		<form id="myform" action="${ctx}/advertiser/main/ad/report/advertiser-report" method="post">
	 			<input type="hidden" id="page" name="page" value="${pager.page!}"/>
	 			<input type="hidden" id="dateTab" name="dateTab" value="${dateTab!}"/>
	 			<div id="content_choose">	
					<input type="hidden" name="selecteddimensionId" id="dimensionId" value="${selecteddimensionId!}">
					<input type="hidden" name="selecteddimensionName" id="dimensionName" value="${selecteddimensionName!}">
					<span id="dateChoose_span">
						<a value="today">今天</a> |
						<a id="yesterday" value="yesterday">昨天</a> |
						<a value="lastSevenDays">前七天</a> |
						<a value="lastWeek">上周</a> |
						<a value="thisMonth">本月</a> |
						<a value="lastMonth">上月</a> 
					</span>
					<span id="calendar_span">
						<i class="icon-calendar"></i>   
						<input type="text" name="dateRangePicker" id="dateRangePicker" value="${dateRangePicker!}" readonly/>
					</span>
				</div>
	 			<div id="selectuls_report">
					<input type="hidden" name="selectedadvertiserId" id="advertiserId" value="${advertiserId!}"/>
					<input type="hidden" name="selectedadvertiserName" id="advertiserName" value="${selectedadvertiserName!}"/>
					<input type="hidden" name="selectedorderId" id="orderId" value="${orderId!}"/>
					<input type="hidden" name="selectedorderName" id="orderName" value="${selectedorderName!}"/>
					<input type="hidden" name="selectedadGroupId" id="adGroupId" value="${adGroupId!}"/>
					<input type="hidden" name="selectedadGroupName" id="adGroupName" value="${selectedadGroupName!}"/>
		  		</div>
		  		<div class="selector operator">
					<div class="sl-wrap single">
						<div class="sl-key">
							<span>广告主：</span>
						</div>
						<div class="sl-value">
							<div class="sl-v-list">
								<ul class="valueList">
									<li class="select_change" value=""><a><i></i>全部</a></li>
								</ul>
							</div>
							<div class="sl-btns">
								<a class="btn btn-primary btnsConfirm disabled" href="javascript:">确定</a>
								<a class="btn btn-default btnsCancel" href="javascript:">取消</a>
							</div>
							<div class="sl-ext">
								<a class="sl-e-multiple extMultiple" href="javascript:">多选<i></i></a>
							</div>
						</div>
					</div>	
				</div>
				<div class="selector size">
					<div class="sl-wrap single">
						<div class="sl-key">
							<span>订单：</span>
						</div>
						<div class="sl-value">
							<div class="sl-v-list">
								<ul class="valueList">
									<li class="select_change" value=""><a><i></i>全部</a></li>
								</ul>
							</div>
							<div class="sl-btns">
								<a class="btn btn-primary btnsConfirm disabled" href="javascript:">确定</a>
								<a class="btn btn-default btnsCancel" href="javascript:">取消</a>
							</div>
							<div class="sl-ext">
								<a class="sl-e-multiple extMultiple" href="javascript:">多选<i></i></a>
							</div>
						</div>
					</div>	
				</div>
			    <div class="selector position">
					<div class="sl-wrap single">
						<div class="sl-key">
							<span>策略：</span>
						</div>
						<div class="sl-value">
							<div class="sl-v-list">
								<ul class="valueList">
									<li class="select_change" value=""><a><i></i>全部</a></li>
								</ul>
							</div>
							<div class="sl-btns">
								<a class="btn btn-primary btnsConfirm disabled" href="javascript:">确定</a>
								<a class="btn btn-default btnsCancel" href="javascript:">取消</a>
							</div>
							<div class="sl-ext">
								<a class="sl-e-multiple extMultiple" href="javascript:">多选<i></i></a>
							</div>
						</div>
					</div>	
			    </div>
			    <div style="margin:20px 0;">
			    <input id="btn_formSubmit" type="submit" value="查询"/>
			    <div id="date-checkbox">
			   			<span>显示列（此项可多选）</span>
						<input type="checkbox" name="item" value="impression" checked onclick="hideImpression()"/><span>曝光</span>
						<input type="checkbox" name="item" value="click" checked onclick="hideClick()"/><span>点击</span>
						<input type="checkbox" name="item" value="consume" checked onclick="hideConsume()"/><span>花费</span>
					</div>
			    </div>
			    <div class="scrollTable">
					<table border="1" class="tableFig tableReport">
						<thead>
							<tr class="theadTr">
								<#if dimensionLength ??>
									<th style="width:5%" colspan="${dimensionLength!}"></th>
				            	<#else>
				            		<th style=" width:5%" colspan=1></th>
				            	</#if>
					        	<th class="theadTh hidden-impression" style="width:5%">曝光</th>
					            <th class="theadTh hidden-click" style="width:10%" colspan=2>点击</th>
					            <th class="theadTh hidden-consume" style="width:10%" colspan=2>花费</th>
							</tr>
							<tr class="theadTr">
								<#if dimensionTarget ??>
									<#list dimensionTarget as dimension>
										<td class="theadTd" style="width:5%">${dimension.dimension!}</td>
									</#list>
			            		<#else>
			            			<td class="theadTd" style="width:5%">日期</td>
			            		</#if>
				                <td class="theadTd hidden-impression" style="width:5%">曝光数</td>
				                <td class="theadTd hidden-click" style="width:5%">点击数</td>
				                <td class="theadTd hidden-click" style="width:5%">点击率</td> 
				                <td class="theadTd hidden-consume" style="width:5%">eCPM</td>
				                <td class="theadTd hidden-consume" style="width:5%">花费</td>
				            </tr>
				            <tr class="theadTr">
				            	<#if dimensionTarget ??>
									<#list dimensionTarget as dimension>
										<td class="theadTd">总计</td>
									</#list>
			            		<#else>
			            			 <td class="theadTd">总计</td>
			            		</#if>
			                    <td class="theadTd hidden-impression">${reports.shows!}</td>
			                    <td class="theadTd hidden-click">${reports.clicks!}</td>
			                    <td class="theadTd hidden-click">${reports.clickRates!}%</td> 
			                    <td class="theadTd hidden-consume">${reports.ecpms!}</td>
			                    <td class="theadTd hidden-consume">${reports.consumes!}</td>
		                	</tr>
						</thead>
						<tbody>
							<#if reportList ??>
			            	<#list reportList as report>
							<tr id="tbodyTr">
								<#if dimensionTarget ??>
								<#list dimensionTarget as dimension>
									<#if dimension.dimensionTarget == "date">
									<#setting datetime_format="yyyy-MM-dd"/> 
										<td class="tbodyTd">${report[dimension.dimensionTarget]!?datetime}</td> 
									<#else>
										<td class="tbodyTd">${report[dimension.dimensionTarget]!}</td> 
									</#if>
								</#list>
			            		<#else>
			            			<#setting datetime_format="yyyy-MM-dd"/> 
			            			<td class="tbodyTd">${report.date!?datetime}</td>
			            		</#if>
				                <td class="tbodyTd hidden-impression">${report.show!}</td>
				                <td class="tbodyTd hidden-click">${report.click!}</td>
				                <td class="tbodyTd hidden-click">${report.clickRate!}%</td>  
				               	<td class="tbodyTd hidden-consume">${report.ecpm!}</td>
				                <td class="tbodyTd hidden-consume">${report.consume!}</td>
				            </tr>
							</#list>
							</#if>
						</tbody>
					</table>
				</div>	
		        <div id="exportReport">
					<a id="exportExcel" class="btn_export" href="javascript:void(0);" onClick="exportExcel('banner','${ctx}/advertiser/main/ad/report/advertiser-report/bannerExcel')">导出Excel</a>
				</div>
				<div id="pageDiv">
					<#include "/common/pagination/simple.ftl"/>
				</div>
           </form>
		</div>
    </div>
</div>
</@override>
<@extends name="/common/simple.ftl"/>

